package com.mms.entity.model;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by dan3652@sina.com on 2016-12-28 17:38.
 */
public class Page {
    /**
     * 数据
     */
    private List list = new ArrayList();
    /**
     * 总记录数
     */
    private long totalCount = 0;
    /**
     * 页码
     */
    private Integer pageNo = Integer.valueOf(1);
    /**
     * 页码总数
     */
    private long pageCount = 1;
    /**
     * 每页显示条数
     */
    private Integer pageSize = Integer.valueOf(15);
    /**
     * 排序字段
     */
    private String orderBy = "";
    private OrderType orderType;

    public List getList() {
        return list;
    }

    public void setList(List list) {
        this.list = list;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public long getPageCount() {
        return pageCount;
    }

    public void setPageCount(long pageCount) {
        this.pageCount = pageCount;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public OrderType getOrderType() {
        return orderType;
    }

    public void setOrderType(OrderType orderType) {
        this.orderType = orderType;
    }

    public static enum OrderType {
        asc,
        desc;
        private OrderType() {}
    }

    @Override
    public String toString() {
        return "Page{" +
                "list=" + list +
                ", totalCount=" + totalCount +
                ", pageNo=" + pageNo +
                ", pageCount=" + pageCount +
                ", pageSize=" + pageSize +
                ", orderBy='" + orderBy + '\'' +
                ", orderType=" + orderType +
                '}';
    }
}
